import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('sys_user', { schema: 'lvlu' })
export class SysUser {
  @PrimaryGeneratedColumn({ type: 'int', name: 'user_id' })
  userId: number;

  @Column({ type: 'varchar', name: 'user_name', comment: '用户名', length: 50 })
  userName: string;

  @Column({
    type: 'varchar',
    name: 'password',
    default: '',
    comment: '密码',
    length: 200,
  })
  password: string;

  @Column({
    type: 'varchar',
    name: 'nick_name',
    default: '',
    comment: '昵称',
    length: 100,
  })
  nickName: string;

  @Column({
    type: 'varchar',
    name: 'phone_number',
    nullable: true,
    comment: '手机号',
    length: 11,
  })
  phoneNumber: string | null;

  @Column({
    type: 'varchar',
    name: 'email',
    nullable: true,
    comment: '邮箱',
    length: 50,
  })
  email: string | null;

  @Column({
    type: 'varchar',
    name: 'avatar',
    nullable: true,
    comment: '头像',
    length: 100,
  })
  avatar: string | null;

  @Column({ type: 'int', name: 'sort', nullable: true, comment: '排序' })
  sort: number | null;
}
